const Cc = Components.classes;
const Ci = Components.interfaces;
var displayPaneMgr = Cc["@songbirdnest.com/Songbird/DisplayPane/Manager;1"]
			.getService(Ci.sbIDisplayPaneManager);
var dpInstantiator = displayPaneMgr.getInstantiatorForWindow(window);
var myDisplayPane = dpInstantiator.displayPane;
// Do something neat

// Make a namespace.
if (typeof Birdtune == 'undefined') {
  var Birdtune = {};
}

/**
 * Controller for pane.xul
 */
Birdtune.PaneController = {

  /**
   * Called when the pane is instantiated
   */
  onLoad: function() {
    this._initialized = true;
    
    // Make a local variable for this controller so that
    // it is easy to access from closures.
    var controller = this;
  },
  
  /**
   * Called when the pane is about to close
   */
  onUnLoad: function() {
    this._initialized = false;
  },

};

window.addEventListener("load", function(e) { Birdtune.PaneController.onLoad(e); }, false);
window.addEventListener("unload", function(e) { Birdtune.PaneController.onUnLoad(e); }, false);